services:
  backend:
    container_name: backend
    build:
      context: .
      dockerfile: docker/backend/Dockerfile
    ports:
      - "8000:8000"
    volumes:
      - ./semantic/backend:/app/backend
      - ./data/model.sav:/app/data/model.sav
      - ./semantic/data.json:/app/data.json
      - ./semantic/backend/tmp:/app/tmp
    command: >
       /bin/sh -c "python -m poetry run uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload"

  frontend:
    container_name: frontend
    build:
      context: .
      dockerfile: docker/frontend/Dockerfile
    ports:
      - "3000:3000"
    volumes:
      - ./semantic/frontend/src:/app/src
      - ./semantic/frontend/public:/app/public
    command: >
        /bin/sh -c "npm start"

  webserver:
    container_name: nginx
    build:
      context: .
      dockerfile: docker/webserver/Dockerfile
    ports:
      - "80:80"

